package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankaccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("BankAccountController")
@RequestMapping("/agency/bank-account")
@Api(tags = "机构端 - 机构人员相关接口")
public class BankAccountController {

    @Resource
    private IBankaccountService bankAccountService;

    @PostMapping
    @ApiOperation("新增或更新银行账号信息接口")
    public void addOrUpdateBankAccount(@RequestBody BankAccountUpsertReqDTO bankAccountUpsertReqDTO) {
        bankAccountService.add(bankAccountUpsertReqDTO);
    }

    @GetMapping("/currentUserBankAccount")
    @ApiOperation("获取当前用户银行账号信息接口")
    public BankAccountResDTO currentUserBankAccount() {
        return bankAccountService.getCurrentUserBankAccount();
    }
}